package com.jetpack_sunflower.data

import androidx.room.TypeConverter
import java.util.*

class Converts {

    @TypeConverter
    fun calendarToDatestamp(calendar: Calendar): Long = calendar.timeInMillis

    @TypeConverter
    fun datestampToCalendar(value: Long): Calendar = Calendar.getInstance().apply { timeInMillis = value }

    /**
     * @TypeConverter fun calendarToDatestamp(calendar: Calendar): Long = calendar.timeInMillis

    @TypeConverter fun datestampToCalendar(value: Long): Calendar =
    Calendar.getInstance().apply { timeInMillis = value }
     */
}